package com.spsy.pay.mq;

import com.spsy.common.core.utils.R;
import com.spsy.pay.constant.RabbitMqConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Kyrie Irving
 * @Date: 2025/9/23 17:09
 * @Description:
 **/
@RequestMapping("/mq")
@RestController
@Slf4j
public class RabbitmqSendController {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @PostMapping("/send")
    public R send(){
        rabbitTemplate.convertAndSend(RabbitMqConstant.MQ_EXCHANGE,RabbitMqConstant.MQ_ROUTING,"朱龙博RabbirMq--测试");
        return R.OK();
    }

}
